using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XFFSM;
using XFABManager;
using XFGameFramework;

public class Game_Start : FSMState
{
    
    private StartPanel startPanel;
    public override void OnEnter()
    {
        base.OnEnter();
        Debug.Log("Game_Start OnEnter");
        Module module = userData as Module;

        //初始化游戏外存档
        UserDataController userDataController = module.LoadController<UserDataController>();
        userDataController.applysavedata();
        
        if (module == null) throw new System.Exception("userData is not Module");
        startPanel = module.LoadPanel<StartPanel>();
    }

    public override void OnExit()
    {
        base.OnExit();
        Debug.Log("Game_Start OnExit");

        if (startPanel != null)
        {
            startPanel.Close();
            startPanel = null;
        }

    }
}
